package com.homegoods.designer.presenter;

import android.view.View;
import android.widget.ListAdapter;

import com.homegoods.designer.R;
import com.homegoods.resource.pullDownMenuAdapter.CheckedTextAdapter;
import com.kedll.library.mvp.BasePresenter;
import com.kedll.library.mvp.BaseView;

import java.util.Arrays;

/**
 * @author QiQi
 */
public class EditDesignerInfoPresenter extends BasePresenter<BaseView> {
    private CheckedTextAdapter textAdapter;
    private String[] content;
    private String title;

    public EditDesignerInfoPresenter(BaseView view, String title) {
        super(view);
        this.title = title;
        switch (title) {
            case "设计师经验":
                content = view.getContext().getResources().getStringArray(R.array.designer_exp);
                break;
            case "范围":
                content = view.getContext().getResources().getStringArray(R.array.designer_range);
                break;
            default:
                content = view.getContext().getResources().getStringArray(R.array.designer_price);
                break;
        }
        textAdapter = new CheckedTextAdapter(view.getContext());
        textAdapter.addAll(Arrays.asList(content));
    }

    public ListAdapter getAdapter() {
        return textAdapter;
    }

    public void onConfirmClick(View view) {
        String sel = content[textAdapter.getSelectionIndex()];
        switch (title) {
            case "设计师经验":
                break;
            case "范围":
                break;
            default:
                break;
        }
    }
}